import request from '@/utils/request'
import {client} from '@/utils/tools'
//获取首页数据接口
export function getHome() {
	return request.get('index/lists')
}

//获取菜单
export function getMenu(data) {
	return request.get('menu/lists', {
		params: data,
	});
}

//广告位
export function getAdList(data) {
	return request.get('ad_content/lists', {
		params: data
	});
}

// 购物车列表
export function getCartList() {
	return request.get('cart/lists')
}


//获取好物优选商品列表
export function getBestList(data) {
	return request.get('goods/getBestList', {
		params: data
	});
}

// 商品分类
export function getCatrgory() {
	return request.get('goods_category/lists');
}


//商品详情
export function getGoodsDetail(data) {
	return request.get('goods/getGoodsDetail', {
		params: data
	});
}

// 商品搜索

export function getGoodsSearch(data) {
	return request.get('goods/getGoodsList', {
		params: data
	});
}
//搜索页,热门搜索列表,和历史搜索列表

export function getSearchpage(data) {
	return request.get('goods/getSearchPage', {
		params: data
	});
}
// 清空历史搜索

export function clearSearch() {
	return request.get('goods/clearSearch');
}

//评价列表
export function getCommentList(data) {
	return request.get("goods_comment/lists", {
		params: data
	})
}

// 获取评价列表
export function getOrderCommentList(data) {
	return request.get("goods_comment/getOrderGoods", {
		params: data
	})
}

// 购物车数量更改
export function changeGoodsCount(data) {
	return request.post("cart/change", data)
}

// 单选/全选/店铺选择
export function selectedOpt(data) {
	return request.post("cart/selected", data)
}

// 删除商品
export function deleteGoods(data) {
	return request.post("cart/del", data);
}

//购物车选中状态
export function changeCartSelect(data) {
	return request.post('cart/selected', data)
}

//评价分类
export function getCommentCategory(id) {
	return request.get("/goods_comment/category", {
		params: {
			goods_id: id
		}
	})
}

//加入购物车

export function addCart(data) {
  return request.post('cart/add', data);
} 

 //购物车数量

export function getCartNum(params) {
  return request.get("cart/num", {params});
}


//获取商品热搜榜单
export function getHotGoods(data) {
  return request.get("goods/getHostList", {params: data});
}

// 获取秒杀时间段
export function getSeckillTime() {
	return request.get("/seckill/seckillTime");
}

// 获取秒杀商品
export function getSeckillGoods(params) {
	return request.get("/seckill/seckillGoods", {params})
}

// 消息中心首页
export function getMessageLists() {
	return request.get("notice/index")
}

// 消息通知
export function getNoticeLists(params) {
	return request.get("notice/lists", {params})
}


//商品海报

export function getPoster(data) {
	return request.get("share/sharegoods", {
		params: data
	});
}

// 门店自提列表

export function getStoreList(data) {
	return request.get("selffetch_shop/lists", {
		params: data
	});
}

// 直播列表
export function getLiveRoom(data) {
	return request.get("live_room/lists", {
		params: data
	});
}

// 玉竹兑换排行榜
export function getBambooRank(data) {
	return request.get("goods/bambooRanking", {
		params: data
	});
}


// 获取商品列表-首页
export function getGoodsList(data) {
	return request.get("goods/getGoodsList", {
		params: data
	});
}

// 获取城市名称
export function getCityByLocation(data) {
	return request.get("region/get_city_by_ln_lp", {
		params: data
	});
}

// 获取城市区域
export function getCityArea(data) {
	return request.get("region/get_city_area", {
		params: data
	});
}

// 获取卡包信息
export function getCard(data) {
  return request.post('recharge/rechargeTemplate', data);
} 

// 购买卡包下单接口
export function cardOrder(data) {
  return request.post('recharge/recharge', data);
} 

// 支付接口 -- 卡包订单支付和商品订单支付
export function payment(data) {
  return request.post('payment/prepay', data);
} 

// 提现记录
export function withdrawRecords(data) {
  return request.post('withdraw/records', data);
} 


// 我的邀请
export function myInvite(data) {
	return request.get('user/invitation', {
		params: data
	});
}


// 账户明细接口
export function vaultDetail(data) {
  return request.get('user/accountLog', {
  	params: data
  });
} 

// 苍蝇馆子列表
export function getFlyRestaurant(data) {
	return request.get('article/lists', {
		params: data
	});
}


// 苍蝇馆子详情
export function getArticleDetail(data) {
	return request.get('article/detail', {
		params: data
	});
}


// 我的卡包
export function getMyCard(data) {
	return request.post('user/my_card', data);
}


// 拒绝登录清除用户信息
export function delRelationUntie(data) {
	return request.post('account/relationUntie', data);
}

// 获取赠送玉竹及补贴金额内容(未登录)
export function getCopywriting(data) {
	return request.post('account/getCopywriting', data);
}


// 获取赠送玉竹及补贴金额内容(登录后)
export function getCopywritingLogin(data) {
	return request.post('account/getCopywritingLogin', data);
}

// 获取城市
export function getOpenCity(data) {
	return request.post('account/getOpenCity', data);
}

// 默认城市
export function getDefaultCity(data) {
	return request.post('account/getDefaultCity', data);
}



